package han.chensing.latos.game.elements.effect;

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import han.chensing.latos.res.Res;
import han.chensing.latos.game.elements.LatosElement;
import han.chensing.latos.game.elements.notes.Note;

public class BadEffect extends LatosElement {
    private float alpha=1f;
    public BadEffect(Note badNote){
        super(Res.getInstance().get("effectBad", TextureRegion.class));
        setOrigin(badNote.getOriginX(), badNote.getOriginY());
        setRotation(badNote.getRotation());
        setScale(Note.scale);
        setPosition(badNote.getX(), badNote.getY());
    }

    @Override
    public void lAct(float delta, float currentTime) {
        super.lAct(delta, currentTime);
        alpha-=delta*3;
        if (alpha<=0){
            died=true;
            alpha=0;
        }
        setAlpha(alpha);
    }

    @Override
    public void draw(Batch batch, float alphaModulation) {
        super.draw(batch, alphaModulation);
    }
}
